package com.jlastu.androidsx.fragment;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.jlastu.androidsx.R;
import com.jlastu.androidsx.adapter.FragmentAdapter;
import com.jlastu.androidsx.databinding.FragmentUserHomeBinding;

import java.util.ArrayList;
import java.util.List;

import cn.project.base.baseui.BaseNormalFragment;

public class UserHomeFragment extends BaseNormalFragment<FragmentUserHomeBinding>  {
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_user_home;
    }

    @Override
    protected void initData() {
        FragmentManager fragmentManager = getChildFragmentManager();
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(new MShopListFragment());
        List<String> tab = new ArrayList<>();
        tab.add("全部商品");
        FragmentAdapter fragmentAdapter = new FragmentAdapter(fragmentManager, fragments, tab);
        mBinding.vp.setAdapter(fragmentAdapter);
        mBinding.tl.setupWithViewPager(mBinding.vp);
    }
}
